from django.conf.urls import url
# 注册
from . import views

urlpatterns = [
    # 注册
    url(r'^register/$', views.RegisterView.as_view(), name='register'),
    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$', views.UserCountView.as_view(), name='register'),
    url(r'^mobiles/(?P<mobile>1[345789]\d{9})/count/$', views.MobileCountView.as_view()),
    url('^login/$', views.LoginView.as_view(), name='login'),  # 登录
    url('^logout/$', views.LoginOutView.as_view()),  # 退出登录
    url('^info/$', views.UserInfoView.as_view(), name='info'),  # 用户中心
    url(r'^emails/$', views.EmailView.as_view()),  # 邮箱
    url(r'^emails/verification/$', views.EmailActiveView.as_view()),  # 邮箱激活
    url('^addresses/$', views.AddressView.as_view()),
    url(r'^addresses/create/$',views.AddressCreateView.as_view()), # 新增地址
    url('^addresses/(?P<address_id>\d+)/$', views.AddressEditView.as_view()),
    url('^addresses/(?P<address_id>\d+)/default/$', views.AddressDefaultView.as_view()),
    url('^addresses/(?P<address_id>\d+)/title/$', views.AddressTitleView.as_view()),
    url('^password/$', views.PwdView.as_view()),
]
